Skip to content

Conversation

VladislavAntonyuk
Copy link
Collaborator

@VladislavAntonyuk VladislavAntonyuk commented Jun 12, 2025

Description of Change

Linked Issues

PR Checklist

Additional information

https://vladislavantonyuk.github.io/articles/Turn-any-phone-into-an-IP-Camera-in-30-Minutes-using-.NET-MAUI/

Copy link
Member

@pictos pictos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@VladislavAntonyuk I believe you're using the old Camera2 APi, you should use the CameraX API instead, it will be simpler and it's newer

here for reference https://developer.android.com/media/camera/camerax/video-capture

@VladislavAntonyuk
Copy link
Collaborator Author

@VladislavAntonyuk I believe you're using the old Camera2 APi, you should use the CameraX API instead, it will be simpler and it's newer

here for reference https://developer.android.com/media/camera/camerax/video-capture

I see we reference a NuGet for camera 2, that is why I used this implementation. According to Google camera 2 is not obsolete, but allows you to have a full control of the camera. CameraX just a convenient way to work with camera api. I will update to CameraX.

VladislavAntonyuk and others added 23 commits June 14, 2025 12:11
Ensures proper handling of the video recording stream by setting appropriate file access and share options.
Also, explicitly flushes the stream and nullifies the file after copying to prevent potential issues with file access or deletion.
Addresses an issue where the `VideoRecordEvent` was not correctly identified as the final event.
Updates the `PlatformStartVideoRecording` method signature on Tizen to accept a stream, allowing for greater flexibility in handling video data.
Updated CameraViewPage.xaml to include buttons for starting/stopping video recording and setting night mode. Changed "GetStream" button text to "Save Video Recording" and repositioned "Capture Image" button.

Simplified video file creation in CameraManager.android.cs by removing unnecessary ContentValues. Modified PlatformStopVideoRecording to change flow after stopping video recording.

Enhanced CreateStopVideoRecordingCommand to use async lambda for better asynchronous operation handling.
@VladislavAntonyuk VladislavAntonyuk marked this pull request as ready for review July 19, 2025 11:59
@VladislavAntonyuk VladislavAntonyuk requested review from a team and Copilot July 19, 2025 11:59
@VladislavAntonyuk VladislavAntonyuk self-assigned this Jul 19, 2025
@VladislavAntonyuk
Copy link
Collaborator Author

VladislavAntonyuk commented Sep 8, 2025

Hey @TheCodeTraveler, thank you for the code review. Why did you change StartVideoRecording method to return the stream?
The idea is to pass any stream and record directly to the stream (see Windows implementation). Also we cannot return stream from the StartVideoRecording and we can create fill the stream at the end of the video recording (android).

Updates the camera permission request to also request microphone permissions.

This ensures that the application has the necessary permissions
to record audio when capturing video.
@dotnet-policy-service dotnet-policy-service bot added stale The author has not responded in over 30 days help wanted This proposal has been approved and is ready to be implemented labels Oct 13, 2025
@TheCodeTraveler TheCodeTraveler removed help wanted This proposal has been approved and is ready to be implemented stale The author has not responded in over 30 days labels Oct 14, 2025
Copy link
Collaborator

@TheCodeTraveler TheCodeTraveler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Vlad!!

I updated ICameraView to include the following API:

Task StartVideoRecording(CancellationToken token = default);

This provides an easy path for developers who do not need to provide us a custom Stream.

The developer will then retrieve their video recording Stream from StopVideoRecording:

Stream videoRecordingStream = await StopVideoRecording(CancellationToken.None);

@TheCodeTraveler TheCodeTraveler added pending documentation This feature requires documentation approved This Proposal has been approved and is ready to be added to the Toolkit labels Oct 15, 2025
@TheCodeTraveler TheCodeTraveler enabled auto-merge (squash) October 15, 2025 23:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved This Proposal has been approved and is ready to be added to the Toolkit pending documentation This feature requires documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Proposal] Camera Video Recording

5 participants